#include<stdio.h>
#include<string.h>
void sta(char ch[],int cnt){
	int cnt1=0,cnt2=0,cnt3=0,cnt4=0;
	for(int i=0;i<=cnt;i++)
	{
		if((ch[i]<='z'&&ch[i]>='a')||(ch[i]<='Z'&&ch[i]>='A'))
		    cnt1++;
		else if(ch[i]>='0'&&ch[i]<='9')
		    cnt2++;
		else if(ch[i]==' ')
		    cnt3++;
		else
		    cnt4++;
	}
	printf("%d\t%d\t\n%d\t%d\t",cnt1,cnt2,cnt3,cnt4);
}
int main()
{
	char ch[10000];
	gets(ch);
	int cnt=strlen(ch);
	//cnt+=1;
	sta(ch,cnt);
}